home *** CD-ROM | disk | FTP | other *** search
/ Business Assistant / Business Assistant.iso / indus / rental / statemp.prg < prev    next >
Text File  |  1986-05-29  |  17KB  |  610 lines

  1. **    Last revision: April 6, 1986 at 15:54
  2. * statement printing program
  3. SELE E
  4. USE &dr.:statemnt
  5. STOR 0 TO totalit
  6. STOR 0 TO totalit1
  7. STOR 0 TO netin
  8. GO top
  9. IF nowprint = 'Y'
  10.  GO bottom
  11. ELSE
  12.  STOR '        ' to daya
  13.  @ 15,01 SAY SPACE(75)
  14.  @ 16,01 SAY SPACE(75)
  15.  @ 15,01 SAY '        What is the date of the statement you want to print'
  16.  @ 15,65 GET daya picture '99/99/99'
  17.  READ
  18.  GO TOP
  19.  LOCA for daya = date
  20.  DO WHIL .NOT. EOF()
  21.   IF .NOT. EOF()
  22.    STOR RECNO() TO rec_no
  23.   ENDI .NOT. EOF
  24.   CONT
  25.  ENDD WHILE .NOT. EOF
  26.  IF rec_no = 0
  27.   DO WHIL rec_no = 0
  28.    GO TOP
  29.    @ 15,65 GET daya picture '99/99/99'
  30.    READ
  31.    LOCA for daya = date
  32.    DO WHIL .NOT. EOF()
  33.     IF .NOT. EOF()
  34.      STOR RECNO() TO rec_no
  35.     ENDI .NOT. EOF
  36.     CONT
  37.    ENDD WHILE .NOT. EOF
  38.   ENDD WHILE rec:no = 0
  39.  ENDI rec:no = 0
  40.  IF rec_no <> 0
  41.   GO rec_no
  42.  ENDI rec:no
  43. ENDI nowprint = 'Y'
  44. RELE nowprint
  45. IF stubs
  46.  STOR .t. TO stub
  47. ELSE
  48.  STOR .f. TO stub
  49. ENDI stubs
  50. @ 16,01 SAY SPACE(75)
  51. @ 15,01 SAY "                   Send Statements to the Printer (Y/N)"
  52. @ 15,60 GET printer PICTURE '!'
  53. READ
  54. @ 16,01 SAY "                   Send Statements to a Disk File (Y/N)"
  55. @ 16,60 GET disk PICTURE '!'
  56. READ
  57. STOR LEN(dconame)/2  TO L
  58. STOR 40-L TO L
  59. STOR '                                        ' TO bl
  60. STOR SUBSTR(bl,1,L) + dconame TO coname1
  61. IF disk ='Y'
  62.  @ 18,01 SAY "                   Enter Disk File Name "
  63.  @ 18,44 GET filename PICTURE '!!!!!!!!'
  64.  @ 18,54 SAY "(.TXT will be added )"
  65.  READ
  66.  STOR 'A' to dr
  67.  @ 19,01 SAY '                   Select drive to put Files on'
  68.  @ 19,54 GET dr PICTURE '!'
  69.  READ
  70.  DO WHIL AT(dr,'ABCD') = 0
  71.   @ 19,54 GET dr PICTURE '!'
  72.   READ
  73.  ENDD while @
  74. ENDI disk = Y
  75. @ 15,01 SAY SPACE(75)
  76. @ 16,01 SAY SPACE(75)
  77. @ 17,01 SAY SPACE(75)
  78. @ 18,01 SAY SPACE(75)
  79. @ 19,01 SAY SPACE(75)
  80. IF printer = 'Y'
  81.  @ 16,01 SAY "                        MAKE PRINTER READY AND HIT ANY KEY"
  82.  SET CONSOLE OFF
  83.  WAIT
  84.  SET CONSOLE ON
  85.  CLEA
  86.  @ 10,20 SAY 'Calculating........................................'
  87.  @ 12,00 SAY ' '
  88.  SET print ON
  89. ELSE
  90.  CLEA
  91.  @ 10,20 SAY 'Calculating........................................'
  92.  @ 12,00 SAY ' '
  93. ENDI printer = Y
  94. IF disk = 'Y' .AND. filename <> ' '
  95. * make a proper REPORT file name that is of type TXT
  96.  STOR AT('.',filename) TO length
  97.  IF length = 0 .OR. length > 8
  98.   STOR 9 TO length
  99.  ENDI length
  100.  STOR SUBSTR(filename,1,length-1) TO filename
  101.  STOR '&dr.:'+filename+'.TXT' TO filename
  102.  RELE dr
  103.  SET ALTERNATE TO &filename
  104.  SET ALTERNATE ON
  105. ELSE
  106.  RELE filename
  107. ENDI disk = Y and filename <> ''
  108. IF SUBSTR(daya,4,1) = '0'
  109.  STOR SUBSTR(daya,5,1) TO date2
  110. ELSE
  111.  STOR SUBSTR(daya,4,2) TO date2
  112. ENDI
  113. STOR fyr TO mfyr
  114. IF mfyr < SUBSTR(daya,1,2)
  115.  STOR VAL(fyr)+12 TO mfyr1
  116. ELSE
  117.  STOR VAL(mfyr) TO mfyr1
  118. ENDI mfyr
  119. STOR mfyr1 - VAL(SUBSTR(daya,1,2)) TO mfyr1
  120. STOR mfyr1 + 100 TO mfyr1
  121. STOR STR(mfyr1,3) TO mfyr2
  122. STOR SUBSTR(mfyr2,2,2) TO mfyr
  123. DO CASE
  124. CASE mfyr = '01'
  125.  STOR 'One month ending ' TO date3
  126. CASE mfyr = '02'
  127.  STOR 'Two months ending ' TO date3
  128. CASE mfyr = '03'
  129.  STOR 'Three months ending ' TO date3
  130. CASE mfyr = '04'
  131.  STOR 'Four months ending ' TO date3
  132. CASE mfyr = '05'
  133.  STOR 'Five months ending ' TO date3
  134. CASE mfyr = '06'
  135.  STOR 'Six months ending ' TO date3
  136. CASE mfyr = '07'
  137.  STOR 'Seven months ending ' TO date3
  138. CASE mfyr = '08'
  139.  STOR 'Eight months ending ' TO date3
  140. CASE mfyr = '09'
  141.  STOR 'Nine months ending ' TO date3
  142. CASE mfyr = '10'
  143.  STOR 'Ten months ending ' TO date3
  144. CASE mfyr = '11'
  145.  STOR 'Eleven months ending ' TO date3
  146. CASE mfyr = '12'
  147.  STOR 'Twelve months ending ' TO date3
  148. ENDC
  149. DO CASE
  150. CASE SUBSTR(daya,1,2) = '01'
  151.  STOR 'January ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  152. CASE SUBSTR(daya,1,2) = '02'
  153.  STOR 'February ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  154. CASE SUBSTR(daya,1,2) = '03'
  155.  STOR 'March ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  156. CASE SUBSTR(daya,1,2) = '04'
  157.  STOR 'April ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  158. CASE SUBSTR(daya,1,2) = '05'
  159.  STOR 'May ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  160. CASE SUBSTR(daya,1,2) = '06'
  161.  STOR 'June ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  162. CASE SUBSTR(daya,1,2) = '07'
  163.  STOR 'July ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  164. CASE SUBSTR(daya,1,2) = '08'
  165.  STOR 'August ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  166. CASE SUBSTR(daya,1,2) = '09'
  167.  STOR 'September ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  168. CASE SUBSTR(daya,1,2) = '10'
  169.  STOR 'October ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  170. CASE SUBSTR(daya,1,2) = '11'
  171.  STOR 'November ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  172. CASE SUBSTR(daya,1,2) = '12'
  173.  STOR 'December ' + date2 + ', 19' + SUBSTR(daya,7,2) TO date1
  174. ENDC
  175. STOR TRIM(date1) TO date1
  176. STOR TRIM(date3+date1) TO date3
  177. STOR LEN(date3)/2  TO L
  178. STOR 40-L TO L
  179. STOR '                                        ' TO bl
  180. STOR SUBSTR(bl,1,L) + date3 TO date3
  181. STOR LEN(date1)/2  TO L
  182. STOR 40-L TO L
  183. STOR '                                        ' TO bl
  184. STOR SUBSTR(bl,1,L) + date1 TO date1
  185. RELE L, bl, daya, date2, printer, disk,mfyr, mcyr, mfyr1, mfyr2
  186. STOR .t. TO wholelist
  187. STOR 1 to count
  188. IF com1 = 'C'
  189.  STOR 'BCDEFGHIJKL' TO plan
  190.  STOR .t. TO trial
  191. ELSE
  192.  STOR '6789A012345' TO plan
  193.  STOR .f. TO trial
  194. ENDI com1
  195. STOR 0 TO plus
  196. STOR 0 TO minus
  197. DO WHIL WHOLELIST
  198.  STOR SUBSTR(plan,(count),1) TO chart
  199.  DO CASE
  200.  CASE chart = '1'.OR. chart = 'B'
  201.   STOR code1 TO mcode
  202.   STOR count + 1 TO count
  203.  CASE chart = '2' .OR. chart = 'C'
  204.   STOR code2 TO mcode
  205.   STOR count + 1 TO count
  206.  CASE chart = '3'.OR. chart = 'D'
  207.   STOR code3 TO mcode
  208.   STOR count + 1 TO count
  209.  CASE chart = '4' .OR. chart = 'E'
  210.   STOR code4 TO mcode
  211.   STOR count + 1 TO count
  212.  CASE chart = '5'
  213.   STOR code5 TO mcode
  214.   IF .NOT. stub
  215.    STOR .f. TO wholelist
  216.   ELSE
  217.    STOR 'M789A0X' TO plan
  218.    STOR 1 TO count
  219.   ENDI
  220.  CASE chart = 'X'
  221.   STOR .f. TO wholelist
  222.  CASE chart = 'F'
  223.   STOR code5 TO mcode
  224.   STOR count+1  TO count
  225.  CASE CHART = '6' .OR. chart = 'G' .OR. chart = 'M'
  226.   STOR code6 TO mcode
  227.   STOR count + 1 TO count
  228.  CASE CHART = '7' .OR. chart = 'H'
  229.   STOR code7 TO mcode
  230.   STOR count + 1 TO count
  231.  CASE CHART = '8' .OR. chart = 'I'
  232.   STOR code8 TO mcode
  233.   STOR count + 1 TO count
  234.  CASE CHART = '9' .OR. chart = 'J'
  235.   STOR code9 TO mcode
  236.   STOR count + 1 TO count
  237.  CASE CHART = '0' .OR. chart = 'K'
  238.   STOR code0 TO mcode
  239.   STOR count + 1 TO count
  240.  CASE CHART = 'A'
  241.   STOR codea TO mcode
  242.   STOR count + 1 TO count
  243.  CASE CHART = 'L'
  244.   STOR codea TO mcode
  245.   STOR .f. TO wholelist
  246.  ENDC
  247.  STOR ',' TO C
  248.  STOR 1 TO X
  249.  STOR 1 TO Y
  250.  STOR AT(C,SUBSTR(mcode,x)) TO y
  251.  STOR .t. TO more
  252.  STOR 0 TO countup
  253.  STOR '0' TO nu
  254.  DO WHIL more
  255.   IF Y > 0
  256.    IF VAL(nu) <9
  257.     STOR STR(VAL(SUBSTR(nu,1,1))+1,1) TO nu
  258.    ELSE
  259.     STOR STR(VAL(SUBSTR(nu,1,2))+1,2) TO nu
  260.    ENDI VAL(nu)
  261.    STOR X + Y TO X
  262.    STOR AT(C,SUBSTR(mcode,x)) TO y
  263.    STOR SUBSTR(mcode,x,y-1) TO N&nu
  264.    STOR X + Y TO X
  265.    STOR AT(C,SUBSTR(mcode,x)) TO y
  266.    STOR (VAL(SUBSTR(mcode,x,y-1))*1.00) TO NM&nu
  267.    STOR countup + 1 TO countup
  268.   ELSE
  269.    STOR .f. TO more
  270.   ENDI Y > 0
  271.  ENDD WHILE more
  272.  STOR nu TO last
  273.  STOR 0 TO sumup
  274.  STOR countup-1 to countup
  275.  STOR countup to countup1
  276.  SELE D
  277.  USE &dr.:chart
  278.  STOR '0' TO nu
  279.  DO WHIL &nu  < &last-1
  280.   IF countup > 0
  281.    IF VAL(nu) <9
  282.     STOR STR(VAL(SUBSTR(nu,1,1))+1,1) TO nu
  283.    ELSE
  284.     STOR STR(VAL(SUBSTR(nu,1,2))+1,2) TO nu
  285.    ENDI VAL(nu)
  286.    LOCA FOR N&nu= acctno
  287.    IF comm = 'A' .OR. comm = 'C'
  288.     STOR N&nu + '  ' + desc TO mdesc&nu
  289.    ELSE
  290.     STOR desc TO mdesc&nu
  291.    ENDI comm
  292.    RELE N&nu
  293.    STOR sumup + NM&nu TO sumup
  294.    STOR countup -1 TO countup
  295.   ENDI countup
  296.  ENDD WHILE &nu
  297.  DO CASE
  298.   CLEA
  299.  CASE chart = 'B'
  300.   ? ' '
  301.   ? coname1
  302.   ? '                                 TRIAL BALANCE'
  303.   ? date1
  304.   ? ' '
  305.   ? '----------------------------------------------------------------------------'
  306.   ? 'Acct #    Description                                        Debit     Credit'
  307.   ? '----------------------------------------------------------------------------'
  308.  CASE chart = '1'
  309.